﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/MasterPage.Master" AutoEventWireup="true" CodeBehind="ListArticles.aspx.cs" Inherits="DrivingCRM.Views.Private.CMS.ListArticles" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="banniere" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="nav" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="contenu" runat="server">
<h1>Articles</h1>
    
    Catégorie:
    <asp:DropDownList ID="DDL_Category" runat="server" AutoPostBack="true">
        <asp:ListItem Text="Univers Auto" Value="Univers Auto" />
        <asp:ListItem Text="Univers Moto" Value="Univers Moto" />
        <asp:ListItem Text="Code de la route" Value="Code de la route" />
    </asp:DropDownList>

    <asp:ListView ID="ListView1" runat="server" DataSourceID="DT_Articles">
        <AlternatingItemTemplate>
            <span style="">
            <h2>Article N°<asp:Label ID="Label1" runat="server" Text='<%# Eval("IdArticle") %>' /></h2>
            <br />
            <asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' />
            <br />
            <asp:Label ID="ContentLabel" runat="server" Text='<%# Eval("Content") %>' />
            <br />
        </AlternatingItemTemplate>
        <EditItemTemplate>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <span>Aucun article en base.</span>
        </EmptyDataTemplate>
        <InsertItemTemplate>
        </InsertItemTemplate>
        <ItemTemplate>
            <span style="">
            <h2>Article N°<asp:Label ID="Label1" runat="server" Text='<%# Eval("IdArticle") %>' /></h2>
            <br />
            <asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' />
            <br />
            <asp:Label ID="ContentLabel" runat="server" Text='<%# Eval("Content") %>' />
            <br />
        <br /></span>
        </ItemTemplate>
        <LayoutTemplate>
            <div ID="itemPlaceholderContainer" runat="server" style="">
                <span runat="server" id="itemPlaceholder" />
            </div>
            <div style="">
                <asp:DataPager ID="DataPager1" runat="server">
                    <Fields>
                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                            ShowNextPageButton="False" ShowPreviousPageButton="False" PreviousPageText="Précédent" FirstPageText="Première page" />
                        <asp:NumericPagerField />
                        <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                            ShowNextPageButton="False" ShowPreviousPageButton="False" NextPageText="Suivant" LastPageText="Dernière page" />
                    </Fields>
                </asp:DataPager>
            </div>
        </LayoutTemplate>
        <SelectedItemTemplate>
        </SelectedItemTemplate>
    </asp:ListView>
    <asp:EntityDataSource ID="DT_Articles" runat="server" 
        ConnectionString="name=Model_DrivingCRMContainer" 
        DefaultContainerName="Model_DrivingCRMContainer" EnableFlattening="False" 
        EntitySetName="ArticleSet" EntityTypeFilter="Article"
        OrderBy="it.[IdArticle] DESC"
        Where="it.Category == @SelectedCategory">
        <WhereParameters>
            <asp:ControlParameter ControlID="DDL_Category" DbType="String" Name="SelectedCategory" PropertyName="SelectedValue" />
        </WhereParameters>
    </asp:EntityDataSource>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="footer" runat="server">
</asp:Content>
